local extension = Package:new("iberia")
extension.extensionName = "iberia"

Fk:loadTranslationTable{
  ["iberia"] = "海嗣国战",
  ["iberia_heg"] = "海嗣国战",
  ["repeller"] = "折冲",
  ["counsailor"] = "帷幄",
}

extension:loadSkillSkelsByPath("./packages/iberia/pkg/iberia/rp_skills")
extension:loadSkillSkelsByPath("./packages/iberia/pkg/iberia/cs_skills")
extension:loadSkillSkelsByPath("./packages/iberia/pkg/iberia/sp_skills")

local generals = {}
for _, kingdom in ipairs { "wei", "han", "wu", "jin" } do
  generals[kingdom] = {}
  for _, status in ipairs { "repeller", "counsailor" } do
    generals[kingdom][status] = {}
  end
end

--- 魏·折冲 ---

generals["wei"]["repeller"][1] = {
  name = "iberia_heg__caocao",
  hp = 4,
  skills = {"iberia__guixin"},
  cn_name = "曹操",
  reputation = "翱舞鸿鹄",
  designer = "白蓝海嗣",
}

generals["wei"]["repeller"][29] = {
  name = "iberia_heg__caozhang",
  hp = 4,
  -- skills = {"iberia__zhubei"},  --TODO
  cn_name = "曹彰",
  designer = "白蓝海嗣",
}

generals["wei"]["repeller"][11] = {
  name = "iberia_heg__caoren",
  hp = 4,
  -- skills = {"iberia__jushou"},  --TODO
  cn_name = "曹仁",
  reputation = "天人将军",
  designer = "丫奶",
}

generals["wei"]["repeller"][18] = {
  name = "iberia_heg__caohong",
  hp = 4,
  -- skills = {"iberia__yuanhu"},  --TODO
  cn_name = "曹洪",
  reputation = "福将",
  designer = "白蓝海嗣",
}

generals["wei"]["repeller"][61] = {
  name = "iberia_heg__caochun",
  hp = 4,
  skills = {"iberia__shanjia"},
  cn_name = "曹纯",
  reputation = "虎豹骑首",
  designer = "白蓝海嗣",
}

generals["wei"]["repeller"][38] = {
  name = "iberia_heg__caoxiu",
  hp = 4,
  -- skills = {"iberia__qingxi"},  --TODO
  cn_name = "曹休",
  reputation = "",
  designer = "朱苦力zzccll",
}

generals["wei"]["repeller"][34] = {
  name = "iberia_heg__caozhen",
  hp = 4,
  -- skills = {"iberia__sidi"},  --TODO
  cn_name = "曹真",
  reputation = "荷国天督",
  designer = "白蓝海嗣",
}

generals["wei"]["repeller"][3] = {
  name = "iberia_heg__xiahoudun",
  hp = 4,
  -- skills = {"iberia__shimu"},  --TODO
  cn_name = "夏侯惇",
  reputation = "独眼罗刹",
  designer = "白蓝海嗣",
}

generals["wei"]["repeller"][8] = {
  name = "iberia_heg__xiahouyuan",
  hp = 4,
  -- skills = {"iberia__shensu"},  --TODO
  cn_name = "夏侯渊",
  reputation = "疾驰猎豹",
  designer = "白蓝海嗣",
}

generals["wei"]["repeller"][4] = {
  name = "iberia_heg__zhangliao",
  hp = 4,
  skills = {"iberia__tuxi"},
  cn_name = "张辽",
  reputation = "止啼将军",
  illustrator = "张帅",
}

generals["wei"]["repeller"][16] = {
  name = "iberia_heg__yuejin",
  hp = 4,
  skills = {"iberia__xiaoguo"},
  cn_name = "乐进",
  designer = "白蓝海嗣",
  illustrator = "巴萨小马",
}

generals["wei"]["repeller"][24] = {
  name = "iberia_heg__yujin",
  hp = 4,
  skills = {"iberia__zhenjun"},
  cn_name = "于禁",
  reputation = "讨暴坚垒",
  designer = "白蓝海嗣",
}

generals["wei"]["repeller"][10] = {
  name = "iberia_heg__xuhuang",
  hp = 4,
  skills = {"iberia__jiezi"},
  cn_name = "徐晃",
  reputation = "周亚夫之风",
  designer = "白蓝海嗣",
}

generals["wei"]["repeller"][9] = {
  name = "iberia_heg__zhanghe",
  hp = 4,
  skills = {"iberia__qiaobian"},
  cn_name = "张郃",
  reputation = "巧夺魁义",
  designer = "白蓝海嗣",
}

generals["wei"]["repeller"][5] = {
  name = "iberia_heg__xuchu",
  hp = 4,
  skills = {"iberia__luoyi"},
  cn_name = "许褚",
  reputation = "虎侯",
  designer = "Gilgamesh",
}

generals["wei"]["repeller"][12] = {
  name = "iberia_heg__dianwei",
  hp = 4,
  -- skills = {"iberia__qiangxi"}, -- TODO
  cn_name = "典韦",
  reputation = "古之恶来",
  designer = "白蓝海嗣",
}

generals["wei"]["repeller"][17] = {
  name = "iberia_heg__lidian",
  hp = 4,
  -- skills = {"iberia__wangxi"}, --TODO
  cn_name = "李典",
  reputation = "",
}

generals["wei"]["repeller"][32] = {
  name = "iberia_heg__guohuai",
  hp = 4,
  -- skills = {"iberia__yuzhang"}, --TODO
  cn_name = "郭淮",
  reputation = "",
  designer = "白蓝海嗣",
}

generals["wei"]["repeller"][19] = {
  name = "iberia_heg__wenpin",
  hp = 4,
  skills = {"iberia__zhenwei"},
  cn_name = "文聘",
  reputation = "韬晦壮侯",
  designer = "白蓝海嗣",
}

generals["wei"]["repeller"][23] = {
  name = "iberia_heg__zangba",
  hp = 4,
  skills = {"iberia_hengjiang"},
  cn_name = "臧霸",
  designer = "白蓝海嗣",
}

--- 魏·帷幄 ---

generals["wei"]["counsailor"][13] = {
  name = "iberia_heg__xunyu",
  hp = 3,
  status = "counsailor",
  skills = {"iberia__quhu", "iberia__shenglun"},
  cn_name = "荀彧",
  reputation = "王佐之才",
  designer = "白蓝海嗣",
}

--- 汉·折冲 ---

generals["han"]["repeller"][1] = {
  name = "iberia_heg__liubei",
  kingdom = "han",
  hp = 4,
  skills = {"iberia__rende"},
  cn_name = "刘备",
  reputation = "乱世仁君",
  designer = "白蓝海嗣",
  illustrator = "木美人",
}

generals["han"]["repeller"][2] = {
  name = "iberia_heg__guanyu",
  kingdom = "han",
  hp = 4,
  skills = {"iberia__huwei"},
  cn_name = "关羽",
  reputation = "以武入圣",
  designer = "白蓝海嗣",
  illustrator = "鬼画府",
}

generals["han"]["repeller"][3] = {
  name = "iberia_heg__zhangfei",
  kingdom = "han",
  hp = 4,
  skills = {"iberia__baohe"},
  cn_name = "张飞",
  reputation = "据水断桥",
}

generals["han"]["repeller"][5] = {
  name = "iberia_heg__zhaoyun",
  kingdom = "han",
  hp = 4,
  skills = {"iberia__longdan"},
  cn_name = "赵云",
  reputation = "战场游龙",
  designer = "白蓝海嗣",
}

generals["han"]["repeller"][6] = {
  name = "iberia_heg__machao",
  kingdom = "han",
  hp = 4,
  skills = {"iberia__zhuixi", "iberia__mashu"},
  cn_name = "马超",
  reputation = "西凉雄狮",
  designer = "白蓝海嗣",
}

generals["han"]["repeller"][27] = {
  name = "iberia_heg__liaohua",
  kingdom = "han",
  hp = 4,
  skills = {"iberia__dangxian"},
  cn_name = "廖化",
  reputation = "西归东锋",
  illustrator = "天空之城",
}

-- table.insert(generals, {
--   name = "iberia_heg__liyan",
--   kingdom = "han",
--   hp = 4,
-- 
--   skills = {"iberia__jinwu"},
--   cn_name = "李严",
--   reputation = "腹鳞狎獒",
--   designer = "白蓝海嗣",
--   illustrator = "三国: 谋定天下",

-- })



-- table.insert(generals, {
--   name = "iberia_heg__weiyan",
--   kingdom = "han",
--   hp = 4,
-- 
--   skills = {"iberia__kuanggu"},
--   cn_name = "魏延",
--   reputation = "孤高独狼",
--   designer = "白蓝海嗣",
--   illustrator = "瞌瞌一休",

-- })

-- table.insert(generals, {
--   name = "iberia_heg__liushan",
--   kingdom = "han",
--   hp = 3,
--   status = "counsailor",
--   skills = {"iberia__fangquan", "iberia__anming"},
--   cn_name = "刘禅",
--   reputation = "无为的真命主",
--   designer = "白蓝海嗣",
--   illustrator = "Liuheng",

-- })

-- table.insert(generals, {
--   name = "iberia_heg__yiji",
--   kingdom = "han",
--   hp = 3,
--   status = "counsailor",
--   skills = {"iberia__jijie", "iberia__jiyuan"},
--   cn_name = "伊籍",
--   reputation = "密书求归",
--   designer = "胖即是胖",


-- })

-- table.insert(generals, {
--   name = "iberia_heg__taishici",
--   kingdom = "wu",
--   hp = 4,
-- 
--   skills = {"iberia__tianyi"},
--   cn_name = "太史慈",
--   reputation = "北海酬恩",
--   designer = "白蓝海嗣",
--   illustrator = "Liuheng",

-- })

-- table.insert(generals, {
--   name = "iberia_heg__simayi",
--   kingdom = "jin",
--   hp = 4,
-- 
--   skills = {"iberia__langgu"},
--   cn_name = "司马懿",
--   reputation = "冢虎",
--   designer = "白蓝海嗣",
--   illustrator = "米糊PU",

-- })

-- table.insert(generals, {
--   name = "iberia_heg__simazhao",
--   kingdom = "jin",
--   hp = 4,
-- 
--   skills = {"iberia__daigong"},
--   cn_name = "司马昭",
--   reputation = "嘲风开天",
--   designer = "白蓝海嗣",


-- })

for _, kingdom in ipairs{ "wei", "han", "wu", "jin" } do
  for _, status in ipairs{ "repeller", "counsailor" } do
    local specs = generals[kingdom][status]
    for _, spec in pairs(specs) do
      local general = General:new(extension, spec.name, kingdom, spec.hp)
      general.headnote = status
      if spec.gender then
        general.gender = spec.gender
      end
      if spec.skills then
        general:addSkills(spec.skills)
      end
      if spec.related_skills then
        general:addRelatedSkills(spec.related_skills)
      end

      Fk:loadTranslationTable{
        [general.name] = spec.cn_name or "",
        ["#"..general.name] = spec.reputation or "",
        ["designer:"..general.name] = spec.designer or "",
        ["illustrator:"..general.name] = spec.illustrator or "",
        ["cv:"..general.name] = spec.cv or "",
      }
    end
  end
end

return extension
